<?php



/**
 * This class defines the structure of the 'person' table.
 *
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    propel.generator.ise-php.map
 */
class PersonTableMap extends TableMap
{

	/**
	 * The (dot-path) name of this class
	 */
	const CLASS_NAME = 'ise-php.map.PersonTableMap';

	/**
	 * Initialize the table attributes, columns and validators
	 * Relations are not initialized by this method since they are lazy loaded
	 *
	 * @return     void
	 * @throws     PropelException
	 */
	public function initialize()
	{
		// attributes
		$this->setName('person');
		$this->setPhpName('Person');
		$this->setClassname('Person');
		$this->setPackage('ise-php');
		$this->setUseIdGenerator(true);
		// columns
		$this->addPrimaryKey('PERSONID', 'Personid', 'INTEGER', true, 10, null);
		$this->addColumn('SALUTATION', 'Salutation', 'VARCHAR', false, 20, null);
		$this->addColumn('FIRSTNAME', 'Firstname', 'VARCHAR', true, 50, null);
		$this->addColumn('LASTNAME', 'Lastname', 'VARCHAR', true, 50, null);
		$this->addColumn('EMAIL', 'Email', 'VARCHAR', false, 255, null);
		$this->addColumn('BORN', 'Born', 'DATE', true, null, null);
		$this->addForeignKey('POSTCODE', 'Postcode', 'INTEGER', 'city', 'POSTCODE', false, 5, null);
		$this->addColumn('STREET', 'Street', 'VARCHAR', false, 255, null);
		$this->addColumn('LICENCENR', 'Licencenr', 'INTEGER', true, 10, null);
		$this->addColumn('LICENCESINCE', 'Licencesince', 'DATE', false, null, null);
		// validators
	} // initialize()

	/**
	 * Build the RelationMap objects for this table relationships
	 */
	public function buildRelations()
	{
		$this->addRelation('City', 'City', RelationMap::MANY_TO_ONE, array('postcode' => 'postcode', ), null, null);
		$this->addRelation('Customer', 'Customer', RelationMap::ONE_TO_ONE, array('personid' => 'personid', ), 'CASCADE', 'CASCADE');
		$this->addRelation('Licence', 'Licence', RelationMap::ONE_TO_MANY, array('personid' => 'personid', ), 'CASCADE', 'CASCADE', 'Licences');
	} // buildRelations()

} // PersonTableMap
